<nz-table #nestedTable [nzData]="listOfParentData" nzSize="default" [nzPageSizeOptions]="nzPageSizeOptions" nzShowQuickJumper="true"
  nzShowSizeChanger="true" nzHideOnSinglePage="true" (nzPageIndexChange)="changePageNumber($event)"
  (nzPageSizeChange)="changePageSize($event)" nzFrontPagination="false" [nzTotal]="tableTotal"
  [nzPageSize]="pageSize" [nzPageIndex]="pageNumber">
  <thead>
    <tr>
      <th nzShowExpand></th>
      <th nzWidth="180" nzAlign="center">订单号</th>
      <th nzWidth="180" nzAlign="center">就餐人数</th>
      <th nzWidth="180" nzAlign="center">桌子号</th>
      <th nzWidth="180" nzAlign="center">订单类型</th>
      <th nzWidth="180" nzAlign="center">备注信息</th>
      <th nzWidth="180" nzAlign="center">创建时间</th>
      <th nzWidth="180" nzAlign="center">最后更新时间</th>
    </tr>
  </thead>
  <tbody>
    <ng-template ngFor let-data [ngForOf]="nestedTable.data">
      <tr>
        <td nzShowExpand [(nzExpand)]="data.expand" (nzExpandChange)="expand($event, data)"></td>
        <td nzAlign="center">{{ data.orderNo }}</td>
        <td nzAlign="center">{{ data.personNum }}</td>
        <td nzAlign="center">{{ data.tableId }}</td>
        <td nzAlign="center">
          <span *ngIf="data.goodsType=='2'">退单</span>
          <span *ngIf="data.goodsType=='1'">下单</span>
          <span *ngIf="data.goodsType=='0'">补单</span>
        </td>
        <td nzAlign="right">{{ data.remark }}</td>
        <td nzAlign="center">{{ data.createdAt | date:'yyyy-MM-dd HH:mm:ss'}}</td>
        <td nzAlign="center">{{ data.updatedAt | date:'yyyy-MM-dd HH:mm:ss'}}</td>
      </tr>
      <tr [nzExpand]="data.expand">
        <td></td>
        <td colspan="7">
          <nz-table #innerTable [nzData]="listOfChildrenData" nzSize="middle"  class="table-scroll" [nzShowPagination]="false"
            [nzLoading]="loadData" >
            <thead>
              <tr>
                <th nzWidth="250" nzAlign="center">商品名称</th>
                <th nzWidth="100" nzAlign="center">下单价格</th>
                <th nzWidth="80" nzAlign="center">数量</th>
                <th nzWidth="180" nzAlign="center">操作</th>
              </tr>
            </thead>
            <tbody>
              <tr *ngFor="let data of innerTable.data">
                <td nzAlign="left">{{ data.title }}</td>
                <td nzAlign="center">{{ data.shopPrice }}</td>
                <td nzAlign="right">{{ data.num}}</td>
                <td nzAlign="center">
                  <button nz-button nzType="danger" (click)="rollback(data)">退单</button>
                </td>
              </tr>
            </tbody>
          </nz-table>
        </td>
      </tr>
    </ng-template>
  </tbody>
</nz-table>
